﻿using UnityEngine;
using System.Collections.Generic;

public class UIHierarchy : MonoBehaviour
{
    [System.Serializable]
    public class ItemInfo
    {
        public string name;
        public Object item;

        public ItemInfo() { }
        public ItemInfo(string _name, Object _item) { name = _name; item = _item; }
    }

    // 控件
    public List<ItemInfo> widgets;
    public void SetWidgets(List<ItemInfo> data)
    {
        if (data.Count == 0) return;
        if (widgets == null)
        {
            widgets = new List<ItemInfo>();
        }

        widgets.Clear();
        widgets.AddRange(data);
    }

    // 特效控件
    public List<ItemInfo> effects;

    public void SetEffects(List<ItemInfo> data)
    {
        if (data.Count == 0) return;
        if (effects == null)
        {
            effects = new List<ItemInfo>();
        }
        effects.Clear();
        effects.AddRange(data);
    }

    // 外部引用
    public List<ItemInfo> externals;
}